#include <string.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>

using namespace std;

class Singleton{
public:
    static Singleton* getInstance(){
        if(_s==nullptr){
            _s=new Singleton();
        }
        return _s;
    }

private:
    class AutoRlease{
        public:
            ~AutoRlease(){
                if(_s){
                    delete _s;
                    _s=nullptr;
                }
            }
        private:

    };

    Singleton(){}
    ~Singleton(){}



    static Singleton *_s;
    static AutoRlease ar;

};
Singleton* Singleton::_s;
Singleton::AutoRlease Singleton::ar;

void test(){
    Singleton::getInstance();
}

int main()
{
 test();
 return 0;
}

